package com.wangsd.web.coupon.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@Table(name = "member")
@ApiModel(value = "会员", description = "会员")
public class Member {

    @ApiModelProperty(value = "id")
    /*mybatis plus 自增主键*/
    @TableId(type = IdType.AUTO)
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedTime;

    @ApiModelProperty(value = "（逻辑删除）是否已删；0，未删，1，已删")
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    @ApiModelProperty(value = "微信昵称")
    private String nickName;

    @ApiModelProperty(value = "微信小程序openid")
    private String miniOpenid;

    @ApiModelProperty(value = "性别 1男，2女")
    private String gender;

    @ApiModelProperty(value = "微信头像")
    private String avatarUrl;

    @ApiModelProperty(value = "手机")
    private String mobile;

    @ApiModelProperty(value = "微信公众号openid（发券使用）")
    private String payOpenid;

    @ApiModelProperty(value = "商圈（公司）id")
    private Long companyId;

    @Column(name = "status", columnDefinition = "int(11) default 0 not null")
    @ApiModelProperty(value = "0:非认证会员,1:认证会员")
    private Integer status;

    @Column(name = "state", columnDefinition = "int(11) default 0 not null")
    @ApiModelProperty(value = "0:未认证,1:已认证")
    private Integer state;

    @Column(name = "integral", columnDefinition = "int(20) default 0 not null")
    @ApiModelProperty(value = "积分")
    private Integer integral;

    @Column(name = "continue_day", columnDefinition = "int(20) default 0 not null")
    @ApiModelProperty(value = "连续签到天数")
    private Integer continueDay;

    @ApiModelProperty(value = "父openid")
    private String parentOpenid;

    @ApiModelProperty(value = "父昵称")
    private String parentNickName;

    @Transient
    @TableField(exist = false)
    private String sessionKey;

    @Transient
    @TableField(exist = false)
    private String companyName;

    @Transient
    @TableField(exist = false)
    private String remark;
}
